package com.project.contorller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.CutPagBean;
import com.project.bean.RoomBean;
import com.project.service.IRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("room")
public class RoomController {
    @Autowired
    private IRoomService service;
    @RequestMapping("findAll")
    public IPage<RoomBean> findAllRoom(Integer pageNo, String info, String state, String room, String type){
     return service.findAllRoom(pageNo,info,state,room,type);
    }
    @RequestMapping("delRoom")
    public Boolean delRoom(Integer roomId){
       return service.delRoom(roomId);
    }
    @RequestMapping("findByRooId")
    public RoomBean  findByRooId(int id){
    return service.findByRooId(id);
    }
    @RequestMapping("addRoom")
    public String addRoom(RoomBean roomBean){
        service.addRoom(roomBean);
        return "ok";
    }
    @RequestMapping("findByGender")
    List<RoomBean> findByGender(String gender){
        return service.findByGender(gender);
    }
}
